package com.restaurant.springboot.entity.dto;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

public class CouponSeriesDTO {
    private String name;
    private BigDecimal quota;
    private BigDecimal mixLimit;
    //优惠券开始时间
    private Timestamp startDate;
    //优惠券结束时间
    private Timestamp endDate;
    //领取优惠券时的有效时间,以天为单位
    private int effectiveTime;

    public CouponSeriesDTO(String name, BigDecimal quota, BigDecimal mixLimit, Timestamp startDate, Timestamp endDate, int effectiveTime) {
        this.name = name;
        this.quota = quota;
        this.mixLimit = mixLimit;
        this.startDate = startDate;
        this.endDate = endDate;
        this.effectiveTime = effectiveTime;
    }

    public CouponSeriesDTO() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getQuota() {
        return quota;
    }

    public void setQuota(BigDecimal quota) {
        this.quota = quota;
    }

    public BigDecimal getMixLimit() {
        return mixLimit;
    }

    public void setMixLimit(BigDecimal mixLimit) {
        this.mixLimit = mixLimit;
    }

    public Timestamp getStartDate() {
        return startDate;
    }

    public void setStartDate(Timestamp startDate) {
        this.startDate = startDate;
    }

    public Timestamp getEndDate() {
        return endDate;
    }

    public void setEndDate(Timestamp endDate) {
        this.endDate = endDate;
    }

    public int getEffectiveTime() {
        return effectiveTime;
    }

    public void setEffectiveTime(int effectiveTime) {
        this.effectiveTime = effectiveTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CouponSeriesDTO that = (CouponSeriesDTO) o;
        return effectiveTime == that.effectiveTime &&
                Objects.equals(name, that.name) &&
                Objects.equals(quota, that.quota) &&
                Objects.equals(mixLimit, that.mixLimit) &&
                Objects.equals(startDate, that.startDate) &&
                Objects.equals(endDate, that.endDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, quota, mixLimit, startDate, endDate, effectiveTime);
    }
}
